
#include <stdio.h>

struct person {
	char *name;
	int age;
	char *work;

	void (*printfInfo) (struct person *per);
};

void printfInfo (struct person *per)
{
	printf("name = %s, age =%d, work =%s\n",per->name,per->age,per->work);
}


int main(int argc, char **argv)
{
	struct person persons[] = {
		{"zhangsan",10,"teacher",printfInfo},
		{"lisi",16,"doctor",printfInfo},
	};

	persons[0].printfInfo(&persons[0]);
	persons[1].printfInfo(&persons[1]);
	
	return 0;
}

















